const { db, query } = require("../../db/db");
const util = require("util");

async function GetArticleLikeOtherInfo(req, res) {
  let ArticleId = req.body.ArticleId;
  const select_ArticleLikeOtherInfo_sql = util.format(
    "Select \
    ArticleId,\
    Collect,\
    LikeNum,\
    CommentNum,\
    PageView\
    From Article where ArticleId=%s",
    ArticleId
  );

  const select_ArticleLikeOtherInfo_res = await query(
    select_ArticleLikeOtherInfo_sql
  );

  //基础信息
  const ArticleLikeOthers = {
    LikeNum: select_ArticleLikeOtherInfo_res[0].LikeNum,
    Collect: select_ArticleLikeOtherInfo_res[0].Collect,
    CommentNum: select_ArticleLikeOtherInfo_res[0].CommentNum,
  };

  //查看文章有无点赞

  res.send({
    status: 0,
  });
}

module.exports = { GetArticleLikeOtherInfo };
